import {DeviceModel} from '@/base/model/DeviceModel';
import {deepAssign} from '@/base/util/Objects';

export class DeviceModelAll {
  model: Array<DeviceModel> = [];
  sortName: string = '';
  expand: boolean = true;
  id: number = 0;

  parse(data: JSON) {
    this.sortName = data['sortName'];
    this.expand = data['expand'];
    this.id = data['id'];
    const model = data['model'];
    this.model = model.map(x => {
      const item = new DeviceModel();
      deepAssign(item, x);
      return item;
    })
  }
}
